
module.exports = {
  mode: 'universal',
  /*
  ** Headers of the page
  */
 server: {
    port: 5000,
    host: 'localhost'
  },
  env: {
    baseUrl: process.env.NODE_ENV === 'production' ? process.env.BASE_URL : 'http://localhost:5000'
  },
  router: {
    middleware: 'router',
    extendRoutes (routes, resolve) {
      routes.push({
        path: '/',
        redirect: {
          name: 'index'
        }
      })
    }
  },
  head: {
    title: '句摘文学',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no' },
      { hid: 'keywords', name: 'keywords', content: '句摘文学，句子迷，句子控，优美句子，励志句子' },
      { hid: 'description', name: 'description', content: '句摘文学，文艺青年的家' },
      { name: 'Baiduspider', content: 'index,follow'},
      { name: 'googlebot', content: 'index,follow'}
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress-bar color
  */
  loading: {},
  /*
  ** Global CSS
  */
  css: [
    '@assets/element-variables/theme/index.css',
    '@public/static/css/common.css',
    '@public/static/css/media.css',
    {
      src: '~assets/variables.scss',
      lang: 'scss'
    },
    {
      src: '~assets/common.styl',
      lang: 'stylus'
    }
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '~/plugins/axios.js',
    '~/plugins/element-ui'
  ],
  /*
  ** Nuxt.js dev-modules
  */
  devModules: [
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/style-resources',
    'cookie-universal-nuxt'
  ],
  styleResources: {
    scss: '~assets/variables.scss',
    stylus: '~assets/common.styl'
    // less: './assets/**/*.less',
    // sass: ... 需要什么配置什么，这里是全局的
  },
  /*
  ** Build configuration
  */
  axios: {
  },
  build: {
    transpile: [/^element-ui/],
    /*
    ** You can extend webpack config here
    */
    extend (config, ctx) {
      // 表示在开发模式的 client 端启用 source-map
      // config.devtool = '#source-map' // 添加此行代码
    }
  }
}
